
import re

def help_txt():
    return """
正则表达式帮助模块使用样例, 第1行 正则表达式 第2-End 要匹配的内容
_([a-zA-Z_0-9]+)\s*=
self._x_limit_neg = 0
        self._x_limit_pos = 0
        self._y_limit_neg = 0
        self._y_limit_pos = 0
        self._z_limit_neg = 0
        self._z_limit_pos = 0
        self._a_limit_neg = 0
        self._a_limit_pos = 0
        self._b_limit_neg = 0
        self._b_limit_pos = 0
"""
def process_txt(txt):
    if not txt:
        return "输入为空"
    txt = txt.replace("\r", "\n").replace("\r\n", "\n")
    return_result = []
    
    # 读取参数
    strs = txt.split("\n")
    reg_str = strs[0] # 正则表达式内容
    params = "".join(strs[1:])
        
    matches = re.finditer(reg_str, params)    
    for match in matches:
        return_result.append(match.group(1))
        
    return "\n".join(return_result)